﻿@model Etest.Models.EvaluateTestViewModel
@{
    ViewBag.Title = "EvaluateTest";
}

<h2>EvaluateTest</h2>

<div class="test-page">
    <!-- correct answers -->

    <!-- <div class="correct-answers"> -->
        <table>
            @foreach (var question in Model.correctAnswers)
            {
                <tr>
                    <td>
                        <h1>Correct answers (green)</h1>
                        @question.question_text
                        @foreach (var option in question.QuestionOption)
                        {
                            <br />
                            //ova moze so .css so @ varijabli dynamic css
                            if (option.is_option_correct)
                            {
                            <div style="background-color: #00ff00;">@option.QOption.option_text</div>
                            }
                            else
                            {
                            <div style="background-color: #ff0000;">@option.QOption.option_text</div>    
                            }

                        }
                    </td>
                    <td>
                        <h1>User answers (green)</h1>
                        @question.question_text
                    
                        <!-- ova go pravi View fat --> 
                        <!-- namesto ova moze kako model da se pustat opciite -->
                        @foreach (var option in Model.userAnswers.Where(q=>q.questionId==question.id).ToList())
                        {
                            <br />
                            //ova moze so .css so @ varijabli dynamic css
                            if (option.option_value==true)
                            {
                            <div style="background-color: #00ff00;">@option.QOption.option_text</div>
                            }
                            else
                            {
                            <div style="background-color: #ff0000;">@option.QOption.option_text</div>    
                            }

                        }
                        
                    </td>
                </tr>
            }
        </table>
    <!-- </div> -->
    
    <!-- user answers -->
    <!--
    <div class="user-answers">
        <table>
                   @foreach (var question in Model.correctAnswers)
            {
                <tr>
                    <td>
                        @question.question_text
                        @foreach (var option in question.UserAnswer)
                        {
                            <br />
                            //ova moze so .css so @ varijabli dynamic css
                            if (option.option_value==true)
                            {
                            <div style="background-color: #00ff00;">@option.QOption.option_text</div>
                            }
                            else
                            {
                            <div style="background-color: #ff0000;">@option.QOption.option_text</div>    
                            }

                        }
                    </td>
                </tr>
            }
        </table>
    </div>
    -->
</div>
